$(function () {
    findAllDesigner();
    findAllCompanyName();
});

function findAllDesigner() {
    $.ajax({
        url: '/about/designer',
        data: '',
        type: 'get',
        dataType: 'json',
        success: function (data) {
            // console.log(data.data.AboutDesigner,"00000000");
            setProductData(data.data.AboutDesigner);
        }
    })
}

function setProductData(data) {
    let htmls = '';
    for (let i = 0; i < data.length; i++) {

        htmls += '<div>\n' +
            '                    <div><img src="' + data[i].imgHref + '" width="242px"></div>\n' +
            '                    <div>\n' +
            '                        <div>设计师: ' + data[i].designername + '</div>\n' +
            '                        <div>' + data[i].introduce + '</div>\n' +
            '                    </div>\n' +
            '                </div>';
    }
    $("#designer").html(htmls);
    // console.log($("#designer").html())

}

function findAllCompanyName() {
    $.ajax({
        url: '/about/companyName',
        data: '',
        type: 'get',
        dataType: 'json',
        success: function (data) {
            // console.log(data.data.AboutCompanyName,"66669999");
            setAboutCompanyNameData(data.data.AboutCompanyName);
        }
    })
}

function setAboutCompanyNameData(data) {
    let AboutCompanyNameHtml = '';

    AboutCompanyNameHtml += '<div>\n' +
        '                    <div><img src="' + data[0].picture + '" width="550"></div>\n' +
        '                    <div>\n';

    for (let i = 0; i < data.length; i++) {

        AboutCompanyNameHtml += '<div><img src="' + data[i].picture + '" width="100"></div>\n';


    }
    AboutCompanyNameHtml += '                    </div>\n' +
        '                </div>\n' +
        '                <div>\n' +
        '                    <div>线下门店地址:</div>\n';
    for (let i = 0; i < data.length; i++) {

        AboutCompanyNameHtml += '                    <div>' + data[i].address + '(' + data[i].name + ')</div>\n';
    }
    AboutCompanyNameHtml += '                    </div>';

    $("#AboutCompanyNameHtml").html(AboutCompanyNameHtml);
    // console.log($("#AboutCompanyNameHtml").html())

}